// 路由主配置文件
import Vue from "vue"
import Router from "vue-router"

// 进度条 nprogress
import NProgress from "nprogress"
import "nprogress/nprogress.css"


// 路由数据导入

import { async } from "q";
Vue.use(Router)
import routers from "./index-routers"
import cecPage from "./cec-routers"
import otcPage from "./otc-routers"
import userPage from "./user"
let routes  =[
    ...routers,
    ...cecPage,
    ...otcPage,
    ...userPage,
]
// 导出路由 在main.js中使用
const router = new Router({
    routes
})

router.beforeEach(async (to, from, next) => {
    // 进度条
    NProgress.start()
    next()
})

router.afterEach(to => {
    NProgress.done();
})

/*
*路由拦截
*权限验证
*/


export default router